package com.bTrace;

import org.openjdk.btrace.core.BTraceUtils;
import org.openjdk.btrace.core.annotations.*;

/**
 * 描述:
 *
 * @author luzhongfu
 * Created by lucky on 2020-08-31 4:01 PM
 */
@BTrace
public class DebugBtrace {

    @Export
    static long count;

    @OnMethod(clazz = "com.bTrace.BtraceCase", method = "add" , location = @Location(Kind.RETURN))
    public static void run(@Self Object objectSelf, int a, int b, @Return int result, @Duration long time){
        BTraceUtils.println("parameter: a:"+a + " b:"+b);
        BTraceUtils.println("sum: "+result);
        BTraceUtils.println("time: "+time);
        count ++;
    }

    @OnTimer(1000)
    public static void timer(){
        BTraceUtils.println("count: "+count);
    }
}
